Skip to content

refactor: cleanup, CI fixes, and test coverage#57

Merged
robbycochran merged 9 commits into
mainfrom
rc-cleanupup
Jun 10, 2026
Merged

refactor: cleanup, CI fixes, and test coverage#57
robbycochran merged 9 commits into
mainfrom
rc-cleanupup

Conversation

@robbycochran

@robbycochran robbycochran commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Cleanup and dead code removal:

  • Remove `internal/profile` package — logic moved into `internal/gateway` (`ValidateProviders`) and `cmd/sandbox.go`
  • Add `cmd/launch_test.go` and `internal/gateway/validate_test.go` for new test coverage
  • Tighten Makefile, `dev-harness.sh`, and test scripts

CI: bats integration in unit job:

  • Add bats install + binary build step to CI unit job so `test/preflight.bats` (29 tests) runs on every push
  • Remove bats install from integration jobs (it was misplaced there)

CI: image push policy:

  • Sandbox image now pushes on same-repo PRs (needed by the kind integration job) and skips for fork PRs (no write token)
  • Runner image skips push on all PRs (not needed by kind direct mode)

CI: kind integration fixes:

  • Use `install_only: true` for `helm/kind-action` — `kind-lifecycle.sh` creates its own cluster with an isolated kubeconfig
  • Add "Wait for gateway" step to kind job (mirrors local job) so the local openshell service is ready before tests
  • Skip the 60-90s `podman save | kind load` preload in CI (`CI=true`) — sandbox image is already in the registry; preload only runs in local dev
  • Add retry loop (5× with 3s backoff) to `InferenceGet` in `deployLocal` for resilience against transient daemon reloads after `openshell gateway add`

Test plan

  • `go vet ./...` passes
  • `go test ./...` passes (cmd, internal/agent, internal/gateway, internal/k8s, internal/preflight, internal/status)
  • `bats test/preflight.bats` — 29/29 ok
  • CI green — all 6 checks pass (test, lint, local, kind, sandbox, runner)

- Add bats to CI unit job; skip image push on PRs (fork-safe)
- Remove internal/profile package (dead code, replaced by provider system)
- Add launch and gateway validate test coverage
- Move bats install out of integration jobs; use kind install_only
- Tighten Makefile, dev-harness.sh, and test scripts
- Add `go build -o harness .` before `bats test/preflight.bats` in CI:
  bats tests use `$REPO_ROOT/harness` which must exist.
- Add "Wait for gateway" step to kind job (mirrors local job): removing
  the `test` Makefile prerequisite from `test-kind` eliminated the
  ~2min grace period the bats run accidentally provided, causing
  `harness up` to hit a not-yet-ready local openshell service.
The podman save + kind load image-archive step takes 60-90s and can
make the local openshell service unresponsive by the time test-flow.sh
runs. Poll for up to 60s immediately before handing off to tests.
The podman save + kind load image-archive step takes ~70s and leaves the
local openshell service unresponsive. Restart it via systemctl before
running test-flow.sh, which uses `harness up` (no --remote) and depends
on the local gateway being reachable.
The podman save + kind load archive transfer takes ~70s and starves the
local openshell service, making it unresponsive for subsequent tests.
Run a background keep-alive loop that pings the gateway every 5s during
the transfer instead of restarting after the fact.
The openshell daemon briefly reloads its config after `openshell gateway
add` runs during `deploy kind`, making it transiently unresponsive.
Retry InferenceGet up to 5 times with 3s intervals so harness up can
proceed once the daemon finishes reloading.
images.yml: push sandbox/runner images on same-repo PRs (not fork PRs),
so the integration kind job can pull the image from the registry.

kind-lifecycle.sh: skip the 60-90s podman save+load preload in CI
(CI=true). The preload disrupted the local openshell service; in CI the
image is now available in the registry. Local dev still preloads from the
container daemon for fast iteration without a registry push.
@robbycochran robbycochran merged commit 5f435cb into main Jun 10, 2026
6 checks passed
@robbycochran robbycochran deleted the rc-cleanupup branch June 13, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant